package com.baizhi.controller;


import com.baizhi.entity.Dept;

import com.baizhi.entity.Euser;
import com.baizhi.service.EmpService;
import com.baizhi.service.EuserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;



@CrossOrigin
@RestController
@RequestMapping("euser")
public class EuserController {

    @Autowired
    private EuserService euserService;



    @PostMapping("login")
    public int login( @RequestBody Euser euser){
        int result = euserService.queryEuser(euser);
            if (result == 1) {
                return result;
            } else if (result == 2) {
                return result;
            } else {
                return result;
            }
        }


        @PostMapping("regist")
        public void regist(@RequestBody Euser euser){
            euserService.addEuser(euser);
        }
    }






